
package CSS::Preprocessor::Token;

use strict;
use fields qw(
    position
);
use overload (
    '""' => sub{$_[0]->as_string},
    fallback => 1,
);

sub new {
    my $class = shift;

    return fields::new($class);
}

sub set_position {
    my CSS::Preprocessor::Token $self = shift;
    my CSS::Preprocessor::BufferPos $pos = shift;
    $self->{position} = $pos;
}

sub position {
    return $_[0]->{position};
}

sub as_string {
    my $self = shift;

    my $class = ref($self);
    $class =~ s/^CSS::Preprocessor::Token:://;

    return $class."<".$self->as_string_inner().">";
}

sub as_string_inner {
    return "";
}

1;
